#ifndef ERRORMESSAGEWIDGET_H
#define ERRORMESSAGEWIDGET_H

#include <QLabel>
#include <QWidget>
#include <QPushButton>
#include <QGSettings>
#include <QMessageBox>
#include <QDesktopWidget>
#include <QApplication>

#include <config/config.h>
#include <config/xatom-helper.h>

class ErrorMessageWidget : public QWidget
{
    Q_OBJECT
public:
    explicit ErrorMessageWidget(QWidget *parent = nullptr);
    ~ErrorMessageWidget();
    void ErrCodeAnalysis(QString dev, int errCode);

private:
    QGSettings *gsettings;
    QLabel *warn_icon;
    QLabel *warn_title;
    QLabel *warn_txt;
    QPushButton *ok_btn;
    QMessageBox *mbox = nullptr;
    bool msgBoxShowed = false;


    void GSettingsChanges(QString key);
    void TimeOutLayoutInit(QString dev);
    void showMessageBox(QString title, QString text, QString information);
signals:
    void messageBoxShowed(bool);
};

#endif // ERRORMESSAGEWIDGET_H
